package com.woniu.darryringmall.front.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.darryringmall.front.entity.Collect;
import com.woniu.darryringmall.front.entity.CollectVo;
import com.woniu.darryringmall.front.mapper.CollectMapper;
import com.woniu.darryringmall.front.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 收藏表Service实现
 */
@Service
public class CollectServiceImpl extends ServiceImpl<CollectMapper, Collect> implements CollectService {
    @Autowired
    private CollectMapper collectMapper;

    @Override
    public void add(Collect collect) {
        collectMapper.add(collect);
    }

    @Override
    public void delete(int id) {
        collectMapper.deleteById(id);
    }


    @Override
    public List<CollectVo> getByUserId(int userId) {
        return collectMapper.getByUserId(userId);
    }
}
